package cn.zhentao.dao;

import cn.zhentao.pojo.Teacher;

import java.sql.SQLException;
import java.util.List;

public interface TeacherDao {
    String FIND_ALL="select * from teacher";
    List<Teacher> findAll() throws SQLException;

    String LOGIN="select * from teacher where tname=? and password=?";
    Teacher login(String tname, String password) throws Exception;

    //删除数据
    String DELETE="delete from teacher where tid=?";
    int delTeacher(int tid) throws SQLException;

    //添加数据
    String INSERT = "insert into teacher values(null,?,?,?,?,?)";
    int addTeacher(Teacher t) throws SQLException;

    //修改数据
    String UPDATE="update teacher set tname=?,password=?,hiredate=?,tel=?,address=? where tid=?";
    int updateTeacher(Teacher t) throws SQLException;
}
